<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<definitions id="_7f0c94c0-2a22-445d-b4b7-4fd181e08248"
                  xmlns="http://www.omg.org/spec/CMMN/20151109/MODEL"
                  xmlns:camunda="http://camunda.org/schema/1.0/cmmn"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  targetNamespace="Examples">
  <case id="case" name="Case">

    <casePlanModel id="CasePlanModel_1">
      <planItem id="PI_HumanTask_1" definitionRef="HumanTask_1" />
      <humanTask id="HumanTask_1" name="A HumanTask">
        <extensionElements>
          <camunda:taskListener event="create">
            <camunda:script scriptFormat="groovy">
              def eventName = task.eventName
              def eventCounterName = eventName + "EventCounter"

              task.setVariable(eventName, true)

              def counter = task.getVariable(eventCounterName)

              if (counter == null) {
                counter = 0
              }

              task.setVariable(eventCounterName, counter+1)
            </camunda:script>
          </camunda:taskListener>
        </extensionElements>
      </humanTask>
    </casePlanModel>
  </case>

</definitions>